﻿#ifndef __SS_READ_INI_H__
#define __SS_READ_INI_H__
#include "ssReadFile.h"
#include "../string/ssStrfunc.h"
#include <map>

namespace StarSeeker
{

class ssReadini
{
	typedef std::map<std::string,std::string> KV_T;
public:
	ssReadini();
	~ssReadini() {}
	bool Open(const char* path);
	bool HasNode(const char* node);
	std::string& GetString(const char* node, const char* key, const char* defValue);
	int GetInt32(const char* node, const char* key, int defValue);
	long long GetInt64(const char* node, const char* key, long long defValue);

private:
	bool PushString(const char* node, const char* key, const char* value);

	ssReadFile					m_file;
	std::map<std::string, KV_T>	m_cfg;
	std::string					m_error;
};

}
#endif
